package com.yunjie.service.comprofile;

import java.util.List;
import java.util.Set;

import com.yunjie.model.ComProfile;
import com.yunjie.model.tree.NodeModel;

/**
 * 公司档案业务逻辑接口
 * 
 * @author yoyo
 * 
 */
public interface ProfileService {
	/**
	 * 根据当前节点到树模型
	 * 
	 * @param id
	 *            当前节点id
	 * @return NodeModel对象，该对象已加载所有子节点模型
	 * @throws Exception
	 */
	public NodeModel getTreeModel(Integer id) throws Exception;

	/**
	 * 得到当前节点的一级子节点，子节点中不加载其下层子节点
	 * 
	 * @param id
	 *            当前节点id
	 * @return Set<NodeModel> 一级子节点集合
	 * @throws Exception
	 */
	public Set<NodeModel> getSubNodes(Integer id) throws Exception;
	/**
	 * 获取当前层次的所有树形节点
	 * @param level 当前的树形层次
	 * @return Set<NodeModel> 当前层次节点
	 * @throws Exception
	 */
	public Set<NodeModel> getNodesByLevel(Integer level) throws Exception;

	public ComProfile save(ComProfile profile, Integer parentId) throws Exception;

	public ComProfile updata(ComProfile profile, Integer parentId) throws Exception;

	public boolean delete(Integer id) throws Exception;

	public ComProfile findById(Integer id) throws Exception;

	public List<ComProfile> findByParentId(Integer parentId) throws Exception;

	public List<ComProfile> findByParentId(Integer parentId, Integer page,
			Integer start, Integer limit) throws Exception;

	public List<ComProfile> findAll(Integer page, Integer start, Integer limit)
			throws Exception;
}
